package com.Lyoto.core.controller;

import com.Lyoto.core.enetity.Product;
import com.Lyoto.core.enetity.Result;
import com.Lyoto.core.enetity.annotation.RateLimit;
import com.Lyoto.core.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Lyoto
 * @Description
 * @Date 2022-09-22 11:22
 * @Version
 **/
@RestController
@RequestMapping("/products")
public class ProductController {
    @Autowired ProductService productService;
    
    @RateLimit
    @GetMapping("/info")
    Result<List<Product>> productInfo() {
        return Result.suc("成功响应", productService.selectAll());
    }
    
}
